var express = require('express');
const shopModel = require('../models/ShopModel');
const foodModel = require('../models/FoodModel');
var businessRouter = express.Router();

/* GET home page. */
businessRouter.get('/message', async (req, res) => {
    const { _id } = req.query
    const shopList = await shopModel.find({ _id })
    res.send({
        businessObj: shopList[0]
    })
});

businessRouter.get('/goods/list', async (req, res) => {
    const { shopId } = req.query
    const goodsList = await foodModel.find({ sid: shopId })
    res.send({
        goodsList,
        code: 200,
    })
});

module.exports = businessRouter;